package com.sikulifang.bank.simulation.controller;

import com.sikulifang.bank.simulation.service.IBankService;
import com.sikulifang.bank.simulation.util.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/bank")
public class BankController extends AbstractController<IBankService> {

    @GetMapping("/getBankCode")
    public R<List<String>> getBankCode() {
        return R.ok(service.getBankCode());
    }

    @GetMapping("/start")
    public R<String> start(Integer id) {
        service.start(id);
        return R.ok();
    }

    @GetMapping("/stop")
    public R<String> stop(Integer id) {
        service.stop(id);
        return R.ok();
    }

}
